<?php

namespace backend\controllers;

use Yii;
use backend\models\PayTrade;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use yii\web\ForbiddenHttpException;
use yii\grid\GridView;
use yii\helpers\Html;
use backend\models\UserFootSearch;
use backend\models\UserFoot;
use yii\base\Object;
use backend\models\SysItem;
use backend\models\Show;
use backend\models\Taozhuang;
use backend\models\SysImage;
/**
 * 访问足迹 控制器
 * @author suiyue
 *
 */
class UserFootController extends BaseController
{
	/**
	 * (non-PHPdoc)行为
	 * @see \yii\base\Component::behaviors()
	 */
    public function behaviors()
    {
        return [
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'delete' => ['post'],
                ],
            ],
        ];
    }

    /**
     * (non-PHPdoc)前置函数
     * @see \yii\web\Controller::beforeAction()
     */
    public function beforeAction($action)
    {
    	$action = Yii::$app->controller->action->id;
    	$controller = Yii::$app->controller->id;
    	$action_list = array(
    			'index',
    			'view',
    	);
    	 $access=$this->checkAccess($action_list,$action);//判断操作的action是否在actionlist里面
    	 $this->beforeOp('user-foot', $access);//身份识别 权限验证  action验证
    	 return true;
    }
	/**
	 *  列表
	 */
    public function actionIndex()
    {
    	$searchModel = new UserFootSearch();
    	$data = $searchModel->search(Yii::$app->request->queryParams);
    	$dataProvider=$data['dataProvider'];
    	$acount=$data['acount'];
    	return $this->render('index', [
    			'searchModel' => $searchModel,
    			'dataProvider' => $dataProvider,
    			'acount'=>$acount
    	]);
    }
     
    
    
    
    /**
     * 查看单条数据
     */
    public function actionView($id){
    	$this->layout = 'main_small';
    	$model = AfterService::findOne($id);
    	return $this->render('view', [
    			'model' => $model
    	]);
    }
    
    
   
}
